package com.GUI.Lesson06;
//密码框
import javax.swing.*;
import java.awt.*;

public class TextDemo03 extends JFrame {
    public TextDemo03(){
        Container container = this.getContentPane();

        JPasswordField jPasswordField = new JPasswordField();//默认******
        jPasswordField.setEchoChar('*');
        //jPasswordField.setText("这是密码");
        container.add(jPasswordField);

        //基本
        this.setVisible(true);//没有命名冲突的话才可以省略this
        this.setBounds(10,10,200,200);
        this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);

    }

    public static void main(String[] args) {
        new TextDemo03();
    }
}